<include file="Public/common" />
<block name="css">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        th{text-align: center;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 > 财务管理 &gt;供应商线路结算</h1></div>
    <ul id="nav" class="nav nav-tabs">
      <li role="presentation"  <if condition="$post['status'] eq '-1'">class="active"</if> ><a href="javascript:checkStatus(-1);">待结算</a></li>
      <li role="presentation"  <if condition="$post['status'] eq 1">class="active"</if> ><a href="javascript:checkStatus(1);">结算中</a></li>
      <li role="presentation" <if condition="$post['status'] eq 2">class="active"</if>  ><a href="javascript:checkStatus(2);">已结算</a></li>
    </ul>
    <div class="tab-content">
        <div class="row" >
            <form action="{:U('financeList')}" class="form-inline " method="get" style="margin-left:10px;" >
                <input type="hidden" name="status" value="{$post.status}" style="display: none;">
                <div class="form-group">
                    <label for="lineNum">团号</label>
                    <input type="text" class="" name="lineNum" id="lineNum" placeholder="线路编号" value="{$post.lineNum}">
                </div>
                <div class="form-group">
                    <label for="lineName">线路名称</label>
                    <input type="text" class="" name="lineName" id="lineName" placeholder="线路名称" value="{$post.lineName}">
                </div>
                <div class="form-group">
                    <label for="pushDepartment">成团日期</label>
                    <input type="text" class="" name="group_time" id="group_time" placeholder="成团日期" value="{$post.group_time}">
                </div>
                <button type="submit" class="btn btn-primary btn-sm">查询</button>
            </form>
        </div>


        <table class="table table-striped table-bordered table-hover table-condensed mt-15">
            <thead>
                <tr>
                    <th>团号</th>
                    <th>线路名称</th>
                    <th>总人数</th>
                    <th>团状态</th>
                    <th>成团日期</th>
                    <th>总结算金额（人民币）</th>
                    <th>结算日期</th>
                    <th>操作人</th>
                    <th>结算状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="list" id="vo">
                    <tr>
                        <td>{$vo.group_num}</td>
                        <td>{$vo.line_name}</td>
                        <td>{$vo.received_num}</td>
                        <td>
                            <switch name="vo.group_status">
                                <case value="-1">不成团</case>
                                <case value="1">已成团</case>
                                <case value="2">已出团</case>
                                <case value="3">已回团</case>
                            </switch>
                        </td>
                        <td>{$vo.group_time|date="Y-m-d",###}</td>
                        <td>{$vo.closing_total_money}</td>
                        <td>{$vo.admin2_name}</td>
                        <td>
                            <if condition="$vo['closing_time']">
                                {$vo.closing_time|date="Y-m-d",###}
                            </if>
                        </td>
                        <td>
                            <switch name="vo.closing_status" >
                                <case value="-1">待结算</case>
                                <case value="1">结算中</case>
                                <case value="2">已结算</case>
                                <case value="3">确认完成结算</case>
                            </switch>
                        </td>
                        <td>

                            <a href="{:U('groupCostDetail',array('id'=>$vo['group_id']))}" class="btn btn-warning btn-xs">结算明细</a>

                            <a class="btn btn-primary btn-xs" href="{:U('groupOrderDetail',array('id'=>$vo['group_id']))}">订单详情</a>
                        </td>
                    </tr>
                </volist>
                    <tr>
                        <td colspan="10">
                            {$show}
                        </td>
                    </tr>

            </tbody>
        </table>

    </div>
</block>
<block name="js">
    <script src="__STATIC__/layui/layui.all.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //常规用法
            laydate.render({
                elem: '#group_time'
            });
        });
        function checkStatus(status) {
            $('form')[0].reset();
            $('input[name="status"]').val(status);
            $('form').submit();
        }
    </script>
</block>
